function Toggle(){
	this.binded=[];
	this._=false;
	this.and=function(toggle){
		var me=this;
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(me.value() && toggle.value());};
		afterChange();
		new Toggle().bind(toggle).afterChange=afterChange;
		return retvalue;
		};
	this.or=function(toggle){
		var me=this;
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(me.value() || toggle.value());};
		afterChange();
		new Toggle().bind(toggle).afterChange=afterChange;
		return retvalue;
		};
	this.not=function(toggle){
		var me=this;
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(!me.value());};
		afterChange();
		new Toggle().bind(toggle).afterChange=afterChange;
		return retvalue;
		};
	this.like=function(v1,v2){
		if(v1 instanceof Text){
			if(v2 instanceof Text)return this.likeTextText(v1,v2) 
			else return this.likeTextString(v1,v2)
			}
		else return this.likeStringText(v1,v2)
		}
	this.likeTextText=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value().indexOf(b.value())>-1);};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;	
		return retvalue;
		}
	this.likeStringText=function(a,t){
		return this.like(new Text().value(a),b);
		}
	this.likeTextString=function(a,b){
		return this.like(a,new Text().value(b));
		}
	this.equals=function(v1,v2){
		if(v1 instanceof Text && v2 instanceof Text)return this.equalsExact(v1,v2);
		if(v1 instanceof Amount && v2 instanceof Amount)return this.equalsExact(v1,v2);
		if(v1 instanceof Amount)return this.equalsAmountNumber(v1,v2);
		if(v2 instanceof Amount)return this.equalsNumberAmount(v1,v2);		
		if(v1 instanceof Text)return this.equalsTextString(v1,v2);
		if(v2 instanceof Text)return this.equalsStringText(v1,v2);		
		}
	this.equalsExact=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value()==b.value());};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;		
		return retvalue;
		}
	this.equalsStringText=function(a,b){
		return this.equalsExact(new Text().value(a),b);
		}
	this.equalsTextString=function(a,b){		
		return this.equalsExact(a,new Text().value(b));
		}		
	this.equalsNumberAmount=function(a,b){
		return this.equalsExact(new Amount().value(a),b);
		}	
	this.equalsAmountNumber=function(a,b){		
		return this.equals(a,new Amount().value(b));
		}
	this.less=function(v1,v2){
		if(v1 instanceof Amount && v2 instanceof Amount){return this.lessAmountAmount(v1,v2);}
		if(v1 instanceof Amount){return this.lessAmountNumber(v1,v2);}
		if(v2 instanceof Amount){return this.lessNumberAmount(v1,v2);}
		}
	this.lessAmountAmount=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value()<b.value());};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;		
		return retvalue;
		}
	this.lessAmountNumber=function(a,b){return this.lessAmountAmount(a,new Amount().value(b));}
	this.lessNumberAmount=function(a,b){return this.lessAmountAmount(new Amount().value(a),b);}		
	this.lessOrEquals=function(v1,v2){
		if(v1 instanceof Amount && v2 instanceof Amount)return this.lessOrEqualsAmountAmount(v1,v2) 
		if(v1 instanceof Amount)return this.lessOrEqualsAmountNumber(v1,v2) 
		if(v2 instanceof Amount)return this.lessOrEqualsNumberAmount(v1,v2) 
		return this;
		}
	this.lessOrEqualsAmountAmount=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value()<=b.value());};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;		
		return retvalue;
		}
	this.lessOrEqualsAmountNumber=function(a,b){return this.lessOrEqualsAmountAmount(a,new Amount().value(b));}
	this.lessOrEqualsNumberAmount=function(a,b){return this.lessOrEqualsAmountAmount(new Amount().value(a),b);}	
	this.more=function(v1,v2){
		if(v1 instanceof Amount && v2 instanceof Amount)return this.moreAmountAmount(v1,v2) 
		if(v1 instanceof Amount)return this.moreAmountNumber(v1,v2) 
		if(v2 instanceof Amount)return this.moreNumberAmount(v1,v2) 
		return this;
		}
	this.moreAmountAmount=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value()>b.value());};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;		
		return retvalue;
		}
	this.moreAmountNumber=function(a,b){return this.moreAmountAmount(a,new Amount().value(b));}
	this.moreNumberAmount=function(a,b){return this.moreAmountAmount(new Amount().value(a),b);}
	this.moreOrEquals=function(v1,v2){
		if(v1 instanceof Amount && v2 instanceof Amount)return this.moreOrEqualsAmountAmount(v1,v2) 
		if(v1 instanceof Amount)return this.moreOrEqualsAmountNumber(v1,v2) 
		if(v2 instanceof Amount)return this.moreOrEqualsNumberAmount(v1,v2) 
		return this;
		}
	this.moreOrEqualsAmountAmount=function(a,b){
		var retvalue=new Toggle();
		var afterChange=function(){retvalue.value(a.value()>=b.value());};
		afterChange();
		new It().bind(a).afterChange=afterChange;
		new It().bind(b).afterChange=afterChange;		
		return retvalue;
		}
	this.moreOrEqualsAmountNumber=function(a,b){return this.moreOrEqualsAmountAmount(a,new Amount().value(b));}
	this.moreOrEqualsNumberAmount=function(a,b){return this.moreOrEqualsAmountAmount(new Amount().value(a),b);}	
	}
Toggle.prototype=new It();